#include "Mylogger.hpp"  //1  自定义头文件
//#include <stdio.h>     //2  C头文件
#include <iostream>      //3  C++头文件
                         //4  第三方库头文件

//头文件的顺序问题会导致一些莫名其妙的bug
//一定要注意头文件的顺序
using std::cout;
using std::endl;
using std::string;


void test0()
{
    Mylogger::getInstance()->error("error message");
    Mylogger::getInstance()->warn("warn message");
    Mylogger::getInstance()->info("info message");
    Mylogger::getInstance()->debug("debug message");

    Mylogger::destroy();
}

void test1()
{
    cout << "__FILE__:" << __FILE__ << endl;
    cout << "__FUNCTION__:" << __FUNCTION__ << endl; 
    cout << "__func__:" << __func__ << endl;
    cout << "__LINE__:" << __LINE__ << endl;
}

void test2()
{
    Mylogger::getInstance()->error(addprefix("error message"));
    Mylogger::getInstance()->warn(addprefix("warn message"));
    Mylogger::getInstance()->info(addprefix("info message"));
    Mylogger::getInstance()->debug(addprefix("debug message"));
}

void test3()
{
    cout << "test3()" << endl;
    LogError("error message");
    LogWarn("warn message");
    LogInfo("info message");
    LogDebug("debug message");

    Mylogger::destroy();
}

int main()
{
    /* test0(); */
    /* test1(); */
    /* test2(); */
    test3();

    return 0;
}

